package cn.tedu.charging.cost.dao.impl;


import cn.tedu.charging.common.pojo.param.ChargingProcessParam;
import cn.tedu.charging.cost.dao.mapper.ChargingCostRulePOMapper;
import cn.tedu.charging.cost.dao.repository.ChargingCostRuleRepository;
import cn.tedu.charging.cost.entity.po.ChargingCostRulePO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ChargingCostRuleRepositoryImpl implements ChargingCostRuleRepository {

    @Autowired
    private ChargingCostRulePOMapper chargingCostRulePOMapper;

    @Override
    public List<ChargingCostRulePO> getRulesByStationId(ChargingProcessParam chargingProcessParam) {
        QueryWrapper<ChargingCostRulePO> wrapper = new QueryWrapper<>();
        wrapper.eq("station_id",chargingProcessParam.getStationId());
        List<ChargingCostRulePO> list = chargingCostRulePOMapper.selectList(wrapper);
        return list;
    }
}
